package org.stvd.entities.common;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.core.annotation.serializer.DateTimeSerializer;
import org.stvd.entities.base.BaseEntity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * @Title AuditFlow
 * @Destribution 审核记录-实体类
 * @author houzx
 * @date 2020年4月1日
 */
@Entity
@Table(name = "audit_flow")
public class AuditFlow extends BaseEntity{

    private static final long serialVersionUID = 3104381999260925250L;
    
    /**
     * 主键ID
     */
    @Id
    @Column(name = "id", nullable = false)
    private String id = "";
    
    /**
     * 待审核记录源数据表名
     */
    @Column(name = "source_table", nullable = false)
    @NotEmpty(message="待审核记录源数据表名不能为空")
    private String sourceTable = "";
    
    /**
     * 待审核记录源数据主键ID
     */
    @Column(name = "source_id", nullable = false)
    @NotEmpty(message="待审核记录源数据ID不能为空")
    private String sourceId = "";
    
    /**
     * 当前审核人ID
     */
    @Column(name = "curr_auditor", nullable = false)
    @NotEmpty(message="当前审核人ID不能为空")
    private String currAuditor = "";
    
    /**
     * 下阶段审核人ID
     */
    @Column(name = "next_auditor")
    private String nextAuditor = "";
    
    /**
     * 最终审核结果
     */
    @Column(name = "final_result", nullable = false)
    @NotEmpty(message="审核结果不能为空")
    private String finalResult = "";
    
    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date createTime = null;

    /**
     * 修改时间
     */
    @Column(name = "modify_time", nullable = false)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date modifyTime = null;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSourceTable() {
        return sourceTable;
    }

    public void setSourceTable(String sourceTable) {
        this.sourceTable = sourceTable;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public String getCurrAuditor() {
        return currAuditor;
    }

    public void setCurrAuditor(String currAuditor) {
        this.currAuditor = currAuditor;
    }

    public String getNextAuditor() {
        return nextAuditor;
    }

    public void setNextAuditor(String nextAuditor) {
        this.nextAuditor = nextAuditor;
    }

    public String getFinalResult() {
        return finalResult;
    }

    public void setFinalResult(String finalResult) {
        this.finalResult = finalResult;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    
}
